/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bd2;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 *
 * @author tolkjen
 */
public class KursyTableAdapter extends MouseAdapter {
    
    private MainFrame window;
    
    KursyTableAdapter(MainFrame frame) {
        window = frame;
    }
    
    @Override
    public void mouseClicked(MouseEvent e) {
        if (e.getClickCount() == 2) {
            KursyTable table = (KursyTable) e.getSource();
            int row = table.getSelectedRow();
            Integer id = (Integer) table.getRow(row)[0];
            window.showKurs(id);
        }
    }
}
